(function($) {
	
	$(function() {
		var $money_color_type = $('#color-type').find('.money-color-type');
		$('.repay-buy').on('click', function() {
			var $reserveModal = $('#reserveModal')
			$reserveModal.modal('hide');
			$reserveModal.on('hidden.bs.modal', function() {
				$('#repayModal').modal();
			});
		});
		$money_color_type.on('click', function() {
			var color_type = $(this).attr('data-type'),
				$color_type_img = $('#color-type-img');
			$money_color_type.removeClass('money-color-type-border');
			$(this).addClass('money-color-type-border');
			if ('blank' == color_type) {
				$color_type_img.attr('src', '../img/detail/1.jpg');
			}else if ('red' == color_type) {
				$color_type_img.attr('src', '../img/detail/4.jpg');
			}else if ('coffeered' == color_type) {
				$color_type_img.attr('src', '../img/detail/Comp3-03.jpg');
			}
		});
		var nnum = 1;
		var $input_number = $('#input-number');
		$('#increase').on('click', function() {
			nnum++;
			$input_number.val(nnum);
		});
		$('#decrease').on('click', function() {
			if (nnum > 1) {
				nnum--;
			}
			$input_number.val(nnum);
		});
	});
})(jQuery)